<?
include "DBConnect.php";
include "funcoes.php";

valida_sessao();

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
	<HEAD>
		<HEAD>
		<TITLE>SRSystem - <?echo $_SESSION['nome_usuario']?></TITLE>
		<LINK rel="shortcut icon" href="layout/favicon.ico"/>
		<LINK rel="stylesheet" type="text/css" href="css/padrao.css"/>
		<LINK rel="stylesheet" type="text/css" href="css/jquery-ui-1.8.10.custom.css"/>
		<SCRIPT language="javascript" type="text/javascript" src="js/jquery/jquery-1.4.4.min.js"></SCRIPT>
		<SCRIPT language="javascript" type="text/javascript" src="js/jquery/jquery-ui-1.8.10.custom.min.js"></SCRIPT>
		<SCRIPT language="javascript" type="text/javascript" src="js/jquery/passwordstrength.js"></SCRIPT>
		<STYLE type="text/css">
			*{
				margin: 0%;
				padding: 0%;
			}
			
			.conteudo{
				border-collapse: collapse;
			}
			
			.menu{
				position: static;
				width: 100%;
				height: 50px;
			}
			
			.header{
				position: static;
				width: 100%;
				height: 80px;
			}

			.main{
				position: absolute;
				width: 85%;
				height: 85%;
				left: 15%;
				float: right;
			}
			
			.left{
				position: absolute;
				width: 15%;
				//height: 85%;
				left: 0%;
				float: right;
			}
			
			.barra{
				position: absolute;
				top 0px;
				right: 0px;
				height: 99%;
				width: 20px;
				cursor: pointer
			}
			
			#label_div{
				font-size: 6pt;
				position: absolute;
				top: 50%;
				text-align: center;
				font-weight: bold;
			}
		</STYLE>
	</HEAD>
	<SCRIPT type="text/javascript" language="javascript">
		$(document).ready(function(){
			var height = (screen.height);
			height = ((height - 150)*100)/height;
			height = height + '%';
			
			$('div.main').css('height', height);
			$('div.left').css('height', height);
			$('#dialog-principal').hide();
			
			if(navigator.appName.indexOf("Internet Explorer") > 0){
				$('#acao_painel').hide();
				$('#left').attr('width', "100%");
			}else{
				$('#acao_painel').click(function(){
					var _dis = ($('#left').css('display'));
					
					if(_dis == "none"){
						var width = (screen.width) * 1;
						width = (width*15)/100;
						
						$('#painel_left').css('width', width);
						
						$('#painel_main').addClass('main').css('margin-left', 0);
						$('#label_div').text(' <<');
						$(this).attr('title', 'Esconder menu lateral');
						$('#left').show();
					}else{
						var width = (screen.width) * 1;
						
						$('#painel_left').css('width', 20);
						$('#painel_main').removeClass('main').css('margin-left', 20);
						$('#label_div').text('>>');
						$(this).attr('title', 'Exibir menu lateral');
						$('#left').hide();
					}
				});
			}
		});
		
		function clicar_menu(){
			parent.left.clicar();
		}
		
		/*
		function updateTips( t ) {
			var tips = $( ".validateTips" );
			
			tips
				.text( t )
				.addClass( "ui-state-highlight" );
			setTimeout(function() {
				tips.removeClass( "ui-state-highlight", 1500 );
			}, 500 );
		}
		
		function abre(){
			var old_password = $( "#old_password" ),
				new_password = $( "#new_password" ),
				confirm_password = $( "#confirm_password" ),
				allFields = $( [] ).add( old_password ).add( new_password ).add( confirm_password ),
				tips = $( ".validateTips" );
			
			$("#dialog-principal").dialog({
				autoOpen: true,
				height: 350,
				width: 350,
				modal: true,
				zIndex: 3999,
				buttons: {
					Cancelar: function() {
						$(this).dialog("close");
					},
					"Alterar senha >": function(){
						allFields.removeClass("ui-state-error");
						$('form.form_senha').submit();
					}
				},
				close: function() {
					allFields.val("").removeClass( "ui-state-error" );
				}
			});
			
			$("input.validar_password").passwordValidate();
		}
		*/
	</SCRIPT>
	<BODY>
		<DIV class="conteudo header">
			<IFRAME src="header.php" name="header" height="100%" width="100%" frameborder="0" marginheight="0" marginwidth="0" noresize scrolling="NO"></IFRAME>
		</DIV>
		<DIV class="conteudo menu">
			<IFRAME src="menu_top.php" name="menu" height="100%" width="100%" frameborder="0" marginheight="0" marginwidth="0" noresize scrolling="NO"></IFRAME>
		</DIV>
		<DIV style="display: block; clear: both;">
			<DIV class="left ui-widget-header" style="border: 0;" id="painel_left">
				<IFRAME src="" name="left" id="left" height="100%" width="95%" frameborder="0" marginheight="0" marginwidth="0" noresize scrolling="NO"></IFRAME>
				<span class="barra ui-state-highlight" id="acao_painel" title="Esconder menu lateral"><div id="label_div">&lt;&lt;</div></span>
			</DIV>
			<DIV class="main" id="painel_main">
				<IFRAME src="home.php" name="content" height="100%" width="100%" frameborder="0" marginheight="0" marginwidth="0" noresize></IFRAME>
			</DIV>
		</DIV>
		<div id="dialog-principal"></div>
	</BODY>
</HTML>